package test;

import java.sql.*;

public class TryMysql {

	public static void main(String[] args) {
		
		String jdbcurl="jdbc:mysql://localhost:3306/demo";
		String sql="insert into userinfo(name) values('xiaokak111')";
		Connection con;
		Statement st;
		try{
			Class.forName("com.mysql.jdbc.Driver");
			con=DriverManager.getConnection(jdbcurl,"root","123456");
			st=con.createStatement();
			st.executeUpdate(sql);
			System.out.println("会不会出错");
			st.close();
			con.close();
		}catch(Exception ex){
			ex.printStackTrace();
			System.out.println("nonon");
		}
		
		
	}

}
